#include <cellcsp.h>
#include <string>
#include <stdio.h>
#include <csp_debug.h>




int main(){

	int block_all_dma=0, clear_spe_mem=0;

#ifdef BLOCK_ALL_DMA
	block_all_dma=1;
#endif

#ifdef CLEAR_SPE_MEM
	clear_spe_mem=1;
#endif

	ASSERT( block_all_dma );
	ASSERT( clear_spe_mem );
	
	CSPConfig conf;

	char *o2o_write_mnemonic = "o2o_write_process";
	char  *o2o_read_mnemonic = "o2o_read_process";


	char *o2o_read_path =  "./tasks/o2o_write_task";
	char *o2o_write_path = "./tasks/o2o_read_task";
	
	conf.add_csp_program(o2o_write_path, o2o_write_mnemonic);
	conf.add_csp_program(o2o_read_path,  o2o_read_mnemonic);


	CellCSP_start(conf);

	printf("o2o test: communicate 10 integers over o2o channel.\n");

	Parallel par(
		new CSPProcess(o2o_write_mnemonic), 
		new CSPProcess(o2o_read_mnemonic), 
		NULL);

	par.Run();

	CellCSP_end();
	
	return 0;
}
